package com.zjj.learn.designmodel.pattern.factory.factory_method;

/**
 * *** @author zjj_admin
 * *** 2022/4/5 21:03
 */
public class FactoryMethodTest {

    public static void main(String[] args) {
        //创建咖啡店对象
        CoffeeStore store = new CoffeeStore();

       // CoffeeFactory factory = new AmericaCoffeeFactory();
        LatteCoffeeFactory factory1 = new LatteCoffeeFactory();

        store.setFactory(factory1);
        Coffee coffee = store.orderCoffee();

        System.out.println(coffee.getName());
    }
}
